<?php

class homepageActions extends sfActions {

    public function preExecute() {
        date_default_timezone_set(AppTools::TIMEZONE);
    }

    /**
     * Dashboard
     *
     * @param sfWebRequest $request
     */
    public function executeIndex(sfWebRequest $request) {
        $totalCustomers = CustomerTable::getTotal();
        $this->totalCustomers = $totalCustomers;

        $this->salesTotalThisMonth = ReportCore::getSalesTotal(date('Y-m-01'), date('Y-m-t'));
        $this->salesCountThisMonth = ReportCore::getSalesTotal(date('Y-m-01'), date('Y-m-t'), TRUE);
        $this->salesTotalToday = ReportCore::getSalesTotal(date('Y-m-d'), date('Y-m-d'));
    }

}
